package com.sms.gui.listeners;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JOptionPane;

public class MyWindowListener extends WindowAdapter {
    public void windowClosing(WindowEvent e) {
        if (JOptionPane.showConfirmDialog(null,
                "Vuoi davvero chiudere l'applicazione?", "Conferma",
                JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION)
            System.exit(1);
    }
}